package com.lipl.base.javase.designpattern.delegate.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: 15541
 * @Date: 2020/12/15 16:48
 * @Description:
 */
public class Leader {

    //预先知道每个员工的特长、特征，分发任务
    private Map<String,IEmployee> register = new HashMap<String,IEmployee>();

    public Leader(){
        register.put("加密",new EmployeeA());
        register.put("架构",new EmployeeB());
    }

    public void doing(String command){
        register.get(command).doing(command);
    }
}

